package com.m2bshop.shop.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;


import javax.servlet.http.HttpSession;

@Controller
public class RouterController {

    //跳转到钱包页面
    @RequestMapping("/wallet")
    public ModelAndView toWallet(HttpSession session) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("../static/Wallet/Wallet");
        modelAndView.addObject("userid",session.getAttribute("userId"));
        return modelAndView;
    }

    //跳转到新钱包页面
    @RequestMapping("/newwallet")
    public ModelAndView toNewWallet(HttpSession session) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("../static/Wallet/NewWallet");
        modelAndView.addObject("userid",session.getAttribute("userId"));
        return modelAndView;
    }

//    //跳转到品牌商订单页面
//    @RequestMapping("/order")
//    public ModelAndView toOrder(HttpSession session) {
//        ModelAndView modelAndView = new ModelAndView();
//        return modelAndView;
//    }

    //跳转到商品录入
    @RequestMapping("/goodadd")
    public ModelAndView toGoodAdd(HttpSession session) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("good_add");
        modelAndView.addObject("userid",session.getAttribute("userId"));
        return modelAndView;
    }

    //跳转到商品主图
    @RequestMapping("/goodmain")
    public ModelAndView toGoodMain(HttpSession session) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("good_main");
        modelAndView.addObject("userid",session.getAttribute("userId"));
        return modelAndView;
    }

    //跳转到公司信息添加页面
    @RequestMapping("/addcompany")
    public ModelAndView toAddCompany(HttpSession session) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("addcompany");
        modelAndView.addObject("userid",session.getAttribute("userId"));
        return modelAndView;
    }

    //跳转到公司信息编辑页面
    @RequestMapping("/editcompany")
    public ModelAndView toEditCompany(HttpSession session) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("editcompany");
        modelAndView.addObject("userid",session.getAttribute("userId"));
        return modelAndView;
    }

    //跳转到公司品牌商页面
    @RequestMapping("/movinfo")
    public ModelAndView toMvoInfo(HttpSession session) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("movinfo");
        modelAndView.addObject("userid",session.getAttribute("userId"));
        return modelAndView;
    }

    //跳转到借卖方编辑
    @RequestMapping("/editbvo")
    public ModelAndView toEditBvo(HttpSession session) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("editbvo");
        modelAndView.addObject("userid",session.getAttribute("userId"));
        return modelAndView;
    }

    //跳转到借卖方信息页
    @RequestMapping("/bvoinfo")
    public ModelAndView toBvoInfo(HttpSession session) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("bvoinfo");
        modelAndView.addObject("userid",session.getAttribute("userId"));
        return modelAndView;
    }

    //跳转到借卖方店铺管理
    @RequestMapping("/bvostore")
    public ModelAndView toBvoStore(HttpSession session) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("bvostore");
        modelAndView.addObject("userid",session.getAttribute("userId"));
        return modelAndView;
    }

    //跳转至数据字典
    @RequestMapping("/dataDictionary")
    public ModelAndView toDataDictionary(HttpSession session) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("../static/dataDictionary");
        modelAndView.addObject("userid",session.getAttribute("userId"));
        return modelAndView;
    }

    //跳转系统参数
    @RequestMapping("/sysParam")
    public ModelAndView toSysParm(HttpSession session) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("../static/sysParam");
        modelAndView.addObject("userid",session.getAttribute("userId"));
        return modelAndView;
    }

    //跳转到管理员流水
    @RequestMapping("/admintrans")
    public ModelAndView toAdminTrans(HttpSession session) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("../static/Wallet/adminTrans");
        modelAndView.addObject("userid",session.getAttribute("userId"));
        return modelAndView;
    }
}
